import { SimpleSp3D } from "../SimpleSp3D";
import SimpleObjectPool from "../Pool/SimpleObjectPool";



export default abstract class GameToolBase extends SimpleSp3D 
{

    protected m_pool:SimpleObjectPool<GameToolBase>=null;

    public SetPool(Pool:SimpleObjectPool<GameToolBase>){
        this.m_pool=Pool;
    }

    private m_rigibody:Laya.Rigidbody3D=null;
    public get MyRigibody()
    {
        if (this.m_rigibody==null) 
        {
            this.m_rigibody=this.MySprite.getComponent(Laya.Rigidbody3D);    
        }
        return this.m_rigibody;
    }



    protected OnBeforeDestroy() 
    {
        
    }

    public onTriggerEnter(other:Laya.PhysicsComponent):void 
    {
        this.HandlerTrigger(other);
    }

    
    protected abstract HandlerTrigger(other:Laya.PhysicsComponent);
    

    protected abstract OnBirth();


    protected abstract OnDisappear();

}